package com.imooc.pojo;

import com.baomidou.mybatisplus.annotation.*;
import org.springframework.beans.BeanUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.ToString;

/**
 * 商品分类 
 * 
 * @author yukangkang
 * @email 1304473884@qq.com
 * @date 2021-01-16 21:20:11
 */
@Data
@ToString
@TableName("category")
public class Category implements Serializable {
	private static final long serialVersionUID = 1L;

		/**
		 * 主键
		 */
		@TableId(value = ID, type = IdType.AUTO)
		private Integer id;
		/**
		 * 分类名称
		 */
		@TableField(NAME)
		private String name;
		/**
		 * 分类类型
		 */
		@TableField(TYPE)
		private Integer type;
		/**
		 * 父id
		 */
		@TableField(FATHER_ID)
		private Integer fatherId;
		/**
		 * 图标
		 */
		@TableField(LOGO)
		private String logo;
		/**
		 * 口号
		 */
		@TableField(SLOGAN)
		private String slogan;
		/**
		 * 分类图
		 */
		@TableField(CAT_IMAGE)
		private String catImage;
		/**
		 * 背景颜色
		 */
		@TableField(BG_COLOR)
		private String bgColor;




	public final static String ID =  "`id`";
	public final static String NAME =  "`name`";
	public final static String TYPE =  "`type`";
	public final static String FATHER_ID =  "`father_id`";
	public final static String LOGO =  "`logo`";
	public final static String SLOGAN =  "`slogan`";
	public final static String CAT_IMAGE =  "`cat_image`";
	public final static String BG_COLOR =  "`bg_color`";


	public final static String ID_COMMENT =  "主键";
	public final static String NAME_COMMENT =  "分类名称";
	public final static String TYPE_COMMENT =  "分类类型";
	public final static String FATHER_ID_COMMENT =  "父id";
	public final static String LOGO_COMMENT =  "图标";
	public final static String SLOGAN_COMMENT =  "口号";
	public final static String CAT_IMAGE_COMMENT =  "分类图";
	public final static String BG_COLOR_COMMENT =  "背景颜色";


	public static Category of(Object obj) {
		Category e = new Category();
		BeanUtils.copyProperties(obj, e);
		return e;
	}

	public static QueryWrapper<Category> queryWrapper(Object obj) {
		return new QueryWrapper<>(of(obj));
	}



}
